toast flutter

75

# add this line to your dependencies
fluttertoast: ^7.1.1

Fluttertoast.showToast(
        msg: "This is Center Short Toast",
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.CENTER,
        timeInSecForIosWeb: 1,
        backgroundColor: Colors.red,
        textColor: Colors.white,
        fontSize: 16.0
    );
Scaffold.of(context).showSnackBar(SnackBar(
      content: Text("Sending Message"),
    ));
Toast.show("Toast plugin app", duration: Toast.lengthShort, gravity:  Toast.bottom);
dependencies:
  fluttertoast: ^8.0.8
Fluttertoast.showToast(
        msg: "This is Center Short Toast",
        toastLength: Toast.LENGTH_SHORT,
        gravity: ToastGravity.CENTER,
        timeInSecForIosWeb: 1,
        backgroundColor: Colors.red,
        textColor: Colors.white,
        fontSize: 16.0
    );
# add this line to your dependencies
# put the current version
fluttertoast: ^8.0.9 

# import file
import 'package:fluttertoast/fluttertoast.dart';

# Usage
Fluttertoast.showToast(
  msg: "This is Center Short Toast",
  toastLength: Toast.LENGTH_SHORT,
  gravity: ToastGravity.CENTER,
  timeInSecForIosWeb: 1,
  backgroundColor: Colors.red,
  textColor: Colors.white,
  fontSize: 16.0
);

Comments

Submit
0 Comments